<style scoped>

</style>
<template>
    <div class="delivery-list-page">
        <el-button class="bolder outsideBtnBS" size="mini" type="danger" @click="returnFather()" style="margin-bottom:16px;">
            <!--<router-link :to="{ path: 'PreInventorySheet'}" >返回</router-link>-->
            返回
        </el-button>
        <el-form :inline="true" :model="formInline" class="demo-form-inline" style="margin-bottom:20px;border-bottom:1px solid #ccc;" :label-width="labelWidth">
            <el-form-item label="预入库单号" class="selectMB10">
                <el-input  v-model="formInline.shipNoticeNo" disabled></el-input>
            </el-form-item>
            <el-form-item label="制单日期" class="selectMB10">
                <el-input  v-model="formInline.createTime" disabled></el-input>
            </el-form-item>
            <el-form-item label="制单人" class="selectMB10">
                <el-input  v-model="formInline.shipNoticceUserName" disabled></el-input>
            </el-form-item>
            <el-form-item label="收货地(简称)" class="selectMB10">
                <el-input  v-model="formInline.shortName" disabled></el-input>
            </el-form-item>
            <el-form-item label="详细地址" class="selectMB10">
                <el-input  v-model="formInline.addressDetail" disabled></el-input>
            </el-form-item>
            <el-form-item label="联系人" class="selectMB10">
                <el-input  v-model="formInline.linkMan" disabled></el-input>
            </el-form-item>
            <el-form-item label="联系电话" class="selectMB10">
                <el-input  v-model="formInline.linkManMobile" disabled></el-input>
            </el-form-item>
            <el-form-item label="备注" class="selectMB10">
                <el-input  v-model="formInline.shipNoticeBak" disabled></el-input>
            </el-form-item>
        </el-form>
        <el-table :data="createDeliveryData" border style="width: 100%" v-loading.body="loading">
            <el-table-column type="index" header-align="center" align="center" label="序"  width="40"></el-table-column>
            <el-table-column
                    prop="poCode"
                    header-align="center"
                    label="PO"
                    show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="currHopeTime"
                    header-align="center"
                    label="期望到货时间"
                    width="120" show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="materialCode"
                    header-align="center"
                    label="备件编码"
                    width="110" show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="materialName"
                    header-align="center"
                    label="备件名称"
                    show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="standard"
                    header-align="center"
                    label="规格"
                    width="100" show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="materialUnit"
                    header-align="center"
                    label="单位"
                    width="100" show-overflow-tooltip>
            </el-table-column>
            <el-table-column
                    prop="shipReqQuantity"
                    header-align="center"
                    label="发货请求数量"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="notReceivedQuantity"
                    header-align="center"
                    label="未发数量"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="currQuantity"
                    header-align="center"
                    label="本次发货数量"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="noticeUnit"
                    header-align="center"
                    label="件（箱）数"
                    width="100">
            </el-table-column>
        </el-table>
    </div>
</template>
<script>
    export default {
        data(){
            return{
                labelWidth:"90px",
                // 查询表单
                formInline:{
                    shipNoticeNo:"",
                    createTime:"",
                    shipNoticceUserName:"",
                    shortName:"",
                    addressDetail:"",
                    linkMan:"",
                    linkManMobile:"",
                    shipNoticeBak:""
                },
                createDeliveryData:[],//送货明细列表
                loading:false

            }
        },
        //进入页面立即运行此方法
        mounted: function () {
            var _this = this;
            _this.$store.commit('currentActive', 'CheckPreSheet');
            _this.formInline.shipNoticeNo=_this.$route.query.shipNoticeNo;//传参,通过预入库单号获取需要查看的信息
            _this.getDeliveryInfor();
        },
        methods: {
            returnFather(){
                var _this=this;
                _this.$router.push({path:"/PreInventorySheet"});
            },
            //点击查看，一进入页面就获取
            getDeliveryInfor(){
                var _this=this;
                _this.loading=true;
                $.ajax({
                    type: 'GET',
                    url: _this.procurement_service+"shipPreNotice/getNoticeDetail?shipNoticeNo="+_this.formInline.shipNoticeNo,
                    cache: false,
                    dataType:'JSON',
                    contentType: "application/json;charset=utf-8",
                    success: function (data) {
                        if(data.success){
                            _this.loading=false;
                            _this.createDeliveryData=data.data.materList;//送货明细表
                            _this.formInline.shipNoticeNo=data.data.shipNoticeNo;//预入库单号
                            _this.formInline.createTime=data.data.createTime;//制单日期
                            _this.formInline.shipNoticceUserName=data.data.shipNoticceUserName;//制单人
                            _this.formInline.shortName=data.data.shortName;
                            _this.formInline.addressDetail=data.data.addressDetail;//送货地
                            _this.formInline.linkMan=data.data.linkMan;//联系人
                            _this.formInline.linkManMobile=data.data.linkManMobile;//联系电话
                            _this.formInline.shipNoticeBak=data.data.shipNoticeBak;//备注
                        }else{
                            _this.common.errorTip(data.errorMessage);
                        }


                    }
                });
            },
            // //成功
            // successTip(p) {     //成功时的提示信息
            //     this.$notify({
            //         title: '成功',
            //         message: p,
            //         type: 'success'
            //     });
            // },
            // //错误
            // errorTip(p) {     //错误提示
            //     this.$notify.error({
            //         title: '错误',
            //         message: p
            //     });
            // }
        }
    }
</script>


